package com.gujiangbo.chapter06;

import java.util.ArrayList;
import java.util.concurrent.TimeUnit;

/**
 * @Author: gujiangbo.co
 * @Contact: 646832012@qq.com
 * @Date: 2022/3/28 22:08
 * @Version: 1.0
 * @Description:
 * 设置堆的初始、最大值
 * -Xms10m -Xmx10m
 * 设置新生代的空间大小
 * -Xmn
 */
public class JavaHeapOom {
    public static void main(String[] args) {
        ArrayList<Object> list = new ArrayList<>();
        for (; ; ) {
            //暂停10秒钟线程
            try{
                TimeUnit.SECONDS.sleep(2);} catch (InterruptedException e) {e.printStackTrace();}
            list.add(new int[100]);
        }
    }
}
